package com.huidu.bitrade.constant;


import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum BipayTransterEnum {
	SUCCESS(200, "成功"),
	SYSTEM_ERR(500, "系统异常"),
	AMOUNT_ERR(581, "提币金额异常"),
	UNKNOWN_COIN(4034, "币种不支持体现"),
	ADDRESS_ERR(4183, "到账地址异常"),
	REPEAT_ORDER(4288, "重复订单号");

	int code;
	String msg;

	public static BipayTransterEnum fromCode(Integer code) {
		for (BipayTransterEnum e : BipayTransterEnum.values()) {
			if (e.code == code) {
				return e;
			}
		}
		return SYSTEM_ERR;
	}

}
